import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/login',
    children:[
      {path: '/user', component: () => import('../views/user/UserView.vue')},
      {path: '/client', component: () => import('../views/user/ClientView.vue')},
      {path: '/branch',component:()=> import('../views/branch/BranchView.vue')},
      {path: '/dishType',component:()=> import('../views/dish/DishTypeView.vue')},
      {path: '/dish',component:()=> import('../views/dish/DishView.vue')},
      {path: '/orders',component:()=> import('../views/orders/OrdersView.vue')},
      {path: '/reservation',component:()=> import('../views/orders/ReservationView.vue')},
      {path: '/statement',component:()=> import('../views/statement/StatementView.vue')}
      ]
  },
  {path: '/login', component: () => import('../views/LoginView')}

]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
